Industrial controllers are special purpose computers used for controlling industrial processes and manufacturing equipment.
Under the direction of a stored program, the industrial controller examines a series of inputs, reflecting the status of the controlled process, and changes outputs effecting control of the industrial process. The inputs and outputs are most simply binary, that is, ON or OFF, however, analog inputs and outputs, assuming a continuous range of values, are also used.
Industrial controllers are frequently programmed in a "relay ladder" language where instructions are represented graphically by "contacts" and "coils" of virtual relays connected and arranged in ladder-like rungs. This relay ladder language with its input contacts and output coils reflects the emphasis in industrial control on the collection and transmission of large numbers of inputs and outputs. The relay ladder language also reflects the fact that most industrial control is "real-time". That is, an ideal industrial controller behaves as if it were composed of multiple relays connected in parallel ladder rungs to produce outputs in essentially instantaneous response to changing inputs.
While relay ladder language type programming is well suited to the handling of large amounts of input and output data and the logical relationship governing such data, it is not well adapted to programming control systems that are logically viewed as moving between discrete "states" in response to historical input and output data. The multiple states of such systems are more easily visualized in state-diagram type languages in which the program is not represented as a simultaneous execution of parallel rungs of relays but instead as a series of interlinked states with execution of the program being the passing from one state to another. For the purpose of this application, conventional computer languages in which the language describes an execution thread of a processor (such as FORTRAN or C) as well as sequential function charts and state diagram-type programs will also be considered state-type languages.
These different programming languages, ladder- and state-type, differ primarily in the way they present the programming tasks to the human programmer, that is prior to actual execution, each programming language is normally compiled to a common set of machine instructions for execution on a conventional Von Neumann-type computer.
Thus, the parallel relay-like structure of a ladder diagram is, in fact, executed sequentially one step at a time and the appearance of parallel operation is obtained by employing extremely fast processors in the execution of the sequential control program. Similarly, the appearance of residing at a given state in a state-type program is obtained by repeated execution of tests and loops by the computer for each given state.
This ability to implement a wide variety of different languages on a single processor platform allows the programmer to select between state-type and ladder-type programming languages, at will, in confronting a particular industrial control problem. Depending on the type of language selected, a different compiler will be used to produce machine executable code.
Often, a single industrial control task will have portions best suited to different types of languages. For example, a programmer might wish to program the part of the control task that collects and disseminates data in a ladder-type language, but wish to program the remainder of the control task in using a state-type language which better reflects the fundamental logic of the control process.
In addition, for large control programs, it would be desirable to write the programs in separate modules or tasks that could be independently run and checked. For example, if the I/O handling were undertaken by a ladder-type program separate from a state-type control program, the ladder program might be separately debugged to evaluate its data handling and generation of Boolean combinations of the inputs and outputs.
Generally, however, integrating different program types in a single application is a difficult task. For example, integrating a ladder-type and state-type language in a single program is complicated by the fact that the ladder language contemplates essentially continuous execution (simulating parallel execution) whereas a state-type program is frequently in one state for an indefinite period of time. Switching between programs on a time basis can detrimentally affect the assumption of simultaneous execution of the ladder rungs, causing adjacent rungs to be executed at significantly different times. If one simply embeds the ladder program as one state in the state-type program, it is difficult to guarantee that the ladder will be executed on a regular basis. Yet forcing the state-type program to periodically go to a particular state (for the execution of the ladder type program) undermines the intent that the state-type program logically represent the states of the actual control process.